﻿using System;

namespace HslCommunication.Core.IMessage
{
	/// <summary>
	/// 用于和 AllenBradley PLC 交互的消息协议类
	/// </summary>
	// Token: 0x0200014E RID: 334
	public class AllenBradleySLCMessage : INetMessage
	{
		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ProtocolHeadBytesLength" />
		// Token: 0x170005B7 RID: 1463
		// (get) Token: 0x06001CD4 RID: 7380 RVA: 0x0008CD94 File Offset: 0x0008AF94
		public int ProtocolHeadBytesLength
		{
			get
			{
				return 28;
			}
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetContentLengthByHeadBytes" />
		// Token: 0x06001CD5 RID: 7381 RVA: 0x0008CD98 File Offset: 0x0008AF98
		public int GetContentLengthByHeadBytes()
		{
			bool flag = this.HeadBytes == null;
			int result;
			if (flag)
			{
				result = 0;
			}
			else
			{
				result = (int)this.HeadBytes[2] * 256 + (int)this.HeadBytes[3];
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.CheckHeadBytesLegal(System.Byte[])" />
		// Token: 0x06001CD6 RID: 7382 RVA: 0x0008CD5E File Offset: 0x0008AF5E
		public bool CheckHeadBytesLegal(byte[] token)
		{
			return true;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetHeadBytesIdentity" />
		// Token: 0x06001CD7 RID: 7383 RVA: 0x00047BE1 File Offset: 0x00045DE1
		public int GetHeadBytesIdentity()
		{
			return 0;
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.HeadBytes" />
		// Token: 0x170005B8 RID: 1464
		// (get) Token: 0x06001CD8 RID: 7384 RVA: 0x0008CDD2 File Offset: 0x0008AFD2
		// (set) Token: 0x06001CD9 RID: 7385 RVA: 0x0008CDDA File Offset: 0x0008AFDA
		public byte[] HeadBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ContentBytes" />
		// Token: 0x170005B9 RID: 1465
		// (get) Token: 0x06001CDA RID: 7386 RVA: 0x0008CDE3 File Offset: 0x0008AFE3
		// (set) Token: 0x06001CDB RID: 7387 RVA: 0x0008CDEB File Offset: 0x0008AFEB
		public byte[] ContentBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.SendBytes" />
		// Token: 0x170005BA RID: 1466
		// (get) Token: 0x06001CDC RID: 7388 RVA: 0x0008CDF4 File Offset: 0x0008AFF4
		// (set) Token: 0x06001CDD RID: 7389 RVA: 0x0008CDFC File Offset: 0x0008AFFC
		public byte[] SendBytes { get; set; }
	}
}
